﻿import com.macromedia.javascript.JavaScriptProxy;

var proxy:JavaScriptProxy;



            // the second parameter is the scope that receives the callbacks from JavaScript

proxy = new JavaScriptProxy(_root.lcId, this);



/**

// the calls to JavaScript to control Windows Media Player

proxy.call("openVideo", vidPath, "12", "40","704", "384", smiPath);

proxy.call("stopVideo");

            */





            // this function is called in the scope specified when the proxy was created

            function videoPlayState(oldstate, newstate) {

trace("videoPlayState old: "+oldstate+", new: "+newstate);



                        // video stopped

                        if (oldstate==2 && newstate == 0) { // from playing to stopped

                                    onVideoFinish();

                        }



                        // video started playing

                        if (oldstate==0 && newstate == 3) { // from stopped to waiting

                                    onVideoStart();

                        }



                        // video started streaming

                        if (oldstate==2 && newstate == 3) { // from playing to waiting for stream

                                    onStreamStart();

                        }

            }





/**

!!!!!!!! Windows Media Player 6.4 !!!!!!!!



Value    VB constant                  Description

            0          mpStopped                  Playback is stopped.

            1          mpPaused                    Playback is paused.

            2          mpPlaying                    Stream is playing.

            3          mpWaiting                    Waiting for stream to begin.

            4          mpScanForward            Stream is scanning forward.

            5          mpScanReverse            Stream is scanning in reverse.

            6          mpSkipForward             Skipping to next.

            7          mpSkipReverse             Skipping to previous.

            8          mpClosed                     Stream is not open.



NOTE: Version 6 ONLY! The state values changed in the later versions.

*/

